<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>CodePen - Login Form with floating placeholder and light button</title>
  <link rel="stylesheet" href="css/style.css">
  <script src="../user/js/jquery-2.1.0.js"></script>

  <script src="../user/js/util.js"></script>
</head>
<body>

<div class="login-box">
  <h2>会员登录</h2>
  <form id="login">
    <div class="user-box">
      <input type="text" name="name" required="">
      <label>用户名</label>
    </div>
    <div class="user-box">
      <input type="password" name="pass" required="">
      <label>密码</label>
    </div>
    <a href="javascript:login()">
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      登录
    </a>
  </form>
</div>

  <script>
    function login() {
      $.ajax({
        type: "post",
        url: baseUrl+"/user/login",
        data: $("#login").serialize(),
        success: function (res) {
          if(res == '1'){
            window.location.href =baseUrl+"/user/list.html";
          }else{
            alert("账号密码不正确！")
          }
        }
      })
    }
  </script>
</body>
</html>
